import request from '@/utils/request'
// 部门列表(树状图组织)
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}
// 新增子部门
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
// 获取部门详情接口
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 编辑子部门的
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
// 删除子部门的
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
